// 开发环境配置
const merge = require('webpack-merge') // webpack 合并配置插件
const common = require('./webpack.common.js') // 引入公共模块配置
const webpack = require('webpack') // 引入webpack

module.exports = merge(common, {
    devtool: 'cheap-module-eval-source-map', // 控制如何生成 source map 
    devServer: {
        contentBase: './dist',
        port: 9000,
        hot: true
    },
    module: {
        rules: [{
            test: /\.js$/,
            exclude: /node_modules/,
            use: 'eslint-loader',
            enforce: 'pre'
        }, ]
    },
    mode: 'development',
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ]
})